* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", sans-serif;
}

body {
    background-color: #0f1c3c;
    color: #e0e6f0;
    min-height: 100vh;
}

#app {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(90deg, #0a1530 0%, #1a2d5d 100%);
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border: 1px solid #2a3e70;
}

.system-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.system-title h1 {
    font-size: 24px;
    background: linear-gradient(90deg, #4dabf7, #339af0);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 1px;
}

.system-title .version {
    background: #1e3a8a;
    color: #60a5fa;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.system-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.device-select {
    width: 280px;
}

.notification-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.current-time {
    background: rgba(30, 58, 138, 0.6);
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    border: 1px solid #3b82f6;
}

.notification-bell {
    position: relative;
    cursor: pointer;
    padding: 10px;
    background: rgba(30, 58, 138, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #3b82f6;
    transition: all 0.3s;
}

.notification-bell:hover {
    background: rgba(59, 130, 246, 0.3);
    transform: scale(1.05);
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.dashboard {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-container {
    background: linear-gradient(135deg, #0f1c3c 0%, #1a2d5d 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border: 1px solid #2a3e70;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h2 {
    font-size: 18px;
    color: #93c5fd;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-header h2 i {
    background: #1e3a8a;
    padding: 5px;
    border-radius: 6px;
    font-size: 16px;
}

.chart-actions {
    display: flex;
    gap: 10px;
}

.chart {
    height: 400px;
    width: 100%;
}

.status-cards {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.status-card {
    background: linear-gradient(135deg, #0f1c3c 0%, #1a2d5d 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid #2a3e70;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #2a3e70;
}

.card-header h3 {
    font-size: 16px;
    color: #93c5fd;
}

.card-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.metric {
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    background: rgba(30, 58, 138, 0.3);
}

.metric-value {
    font-size: 24px;
    font-weight: bold;
    margin: 8px 0;
    color: #3b82f6;
}

.metric-title {
    font-size: 13px;
    color: #a3b3cc;
}

.fault-level {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    margin-top: 5px;
}

.level-high {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.level-medium {
    background: rgba(234, 179, 8, 0.2);
    color: #fbbf24;
}

.level-low {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.info-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.info-panel {
    background: linear-gradient(135deg, #0f1c3c 0%, #1a2d5d 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border: 1px solid #2a3e70;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.panel-header h3 {
    font-size: 18px;
    color: #93c5fd;
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-container {
    max-height: 300px;
    overflow-y: auto;
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
}

.table-container th {
    background: rgba(30, 58, 138, 0.5);
    padding: 12px 15px;
    text-align: left;
    font-size: 14px;
    color: #93c5fd;
    position: sticky;
    top: 0;
}

.table-container td {
    padding: 12px 15px;
    border-bottom: 1px solid #2a3e70;
    font-size: 14px;
}

.table-container tr:last-child td {
    border-bottom: none;
}

.table-container tr:hover {
    background: rgba(30, 58, 138, 0.3);
}

.footer {
    text-align: center;
    padding: 20px;
    color: #93c5fd;
    font-size: 14px;
    border-top: 1px solid #2a3e70;
    margin-top: 20px;
}

.message-dialog {
    background: rgba(15, 28, 60, 0.95);
    border-radius: 12px;
    border: 1px solid #3b82f6;
}

.message-dialog .el-dialog__header {
    background: rgba(30, 58, 138, 0.5);
    border-bottom: 1px solid #2a3e70;
    margin: 0;
    padding: 15px 20px;
    border-radius: 12px 12px 0 0;
}

.message-dialog .el-dialog__title {
    color: #93c5fd;
    font-weight: bold;
}

.message-dialog .el-dialog__body {
    padding: 0;
}

.message-list {
    max-height: 400px;
    overflow-y: auto;
}

.message-item {
    padding: 15px 20px;
    border-bottom: 1px solid #2a3e70;
    cursor: pointer;
    transition: background 0.3s;
}

.message-item:hover {
    background: rgba(30, 58, 138, 0.3);
}

.message-item.unread {
    background: rgba(30, 58, 138, 0.4);
}

.message-title {
    font-weight: bold;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.message-time {
    font-size: 12px;
    color: #a3b3cc;
    margin-top: 5px;
}

.message-content {
    font-size: 14px;
    color: #cbd5e1;
    margin-top: 8px;
}

.message-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3b82f6;
}

.critical {
    color: #f87171;
}

.warning {
    color: #fbbf24;
}

.connection-status {
    display: flex;
    align-items: center;
    margin-left: 15px;
    font-size: 14px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-connected {
    background-color: #10b981;
}

.status-disconnected {
    background-color: #ef4444;
}

.status-reconnecting {
    background-color: #f59e0b;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

.fault-map {
    margin-top: 20px;
    background: rgba(30, 58, 138, 0.3);
    border-radius: 8px;
    padding: 15px;
}

.fault-map h4 {
    color: #93c5fd;
    margin-bottom: 10px;
    font-size: 16px;
}

.fault-map ul {
    list-style-type: none;
    padding-left: 15px;
}

.fault-map li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 15px;
}

.fault-map li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #3b82f6;
}

.message-footer {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed #2a3e70;
    font-size: 13px;
    color: #a3b3cc;
}

.api-status {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
}

.api-success {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.api-failure {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.loading-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.fault-codes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.fault-code {
    padding: 4px 8px;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.fault-code:hover {
    background: rgba(59, 130, 246, 0.35);
}

.fault-code.active {
    background: #3b82f6;
    color: white;
}

@media (max-width: 480px) {
    .algorithm-result-card .feature-grid {
        grid-template-columns: 1fr 1fr;
    }

    .algorithm-controls {
        flex-wrap: wrap;
    }
}
